#include<bits/stdc++.h>
using namespace std;

string s;
int Len;

char a[1010][1010], ans[110][110], P[1000006];
int walk[7][3] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};

struct node {
	int v, id;
};
node z[10];

bool cmp(node x, node y) {
	return x.v < y.v;
}
void dfs(int x, int y, int k, int Min_x, int Max_x, int Min_y, int Max_y) {
	//cerr << k << endl;
	if(k == Len + 1) {
		int dx = Min_x - 1, dy = Min_y - 1;
		int n = Max_x - Min_x + 1, m = Max_y - Min_y + 1;
		cout << n << " " << m << endl;
		for(int i = Min_x; i <= Max_x; i++)
		for(int j = Min_y; j <= Max_y; j++) {
			if(a[i][j] == 'x') ans[i - dx][j - dy] = 'G';
			else ans[i - dx][j - dy] = a[i][j];
		}
		for(int i = 1; i <= n; i++) {
			for(int j = 1; j <= m; j++) cout << ans[i][j];
			cout << endl;
		}
		cout << 200 - dx << " " << 200 - dy << endl;
		for(int i = 2; i <= Len; i++) cout << P[i];
		exit(0);
	}
	
	for(int i = 0; i < 4; i++) {
		int dx = x + walk[i][0], dy = y + walk[i][1];
		if(a[dx][dy] != s[k]) continue;
		if(i == 0) P[k] = 'R';
		else if(i == 1) P[k] = 'D';
		else if(i == 2) P[k] = 'L';
		else P[k] = 'U';
		dfs(dx, dy, k + 1, Min_x, Max_x, Min_y, Max_y);
	}
	
	for(int i = 0; i < 4; i++) {
		int dx = x + walk[i][0], dy = y + walk[i][1];
		int M1x = min(Min_x, dx), M1y = min(Min_y, dy);
		int M2x = max(Max_x, dx), M2y = max(Max_y, dy);
		z[i].v = max(M2x - M1x + 1, M2y - M1y + 1);
		z[i].id = i;
	}
	sort(z, z + 4, cmp);
	for(int I = 0; I < 4; I++) {
		int i = z[I].id;
		int dx = x + walk[i][0], dy = y + walk[i][1];
		int M1x = min(Min_x, dx), M1y = min(Min_y, dy);
		int M2x = max(Max_x, dx), M2y = max(Max_y, dy);
		if(a[dx][dy] != 'x' || max(M2x - M1x + 1, M2y - M1y + 1) > 29) continue;
		if(i == 0) P[k] = 'R';
		else if(i == 1) P[k] = 'D';
		else if(i == 2) P[k] = 'L';
		else P[k] = 'U';
		a[dx][dy] = s[k];
		dfs(dx, dy, k + 1, M1x, M2x, M1y, M2y);
		a[dx][dy] = 'x';
	}
	
}
signed main() {
	freopen("snake.in", "r", stdin);
	freopen("snake.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	cin >> s;
	Len = s.length();
	//cerr << "e" << Len << endl;
	s = " " + s;
	for(int i = 50; i <= 400; i++)
	for(int j = 50; j <= 400; j++) a[i][j] = 'x';
	a[200][200] = s[1];
	dfs(200, 200, 2, 200, 200, 200, 200); 
	return 0;
}
